# -*- encoding: utf-8 -*-
from shapely.wkt import loads as wkt_loads
import dsl
from . import FixtureTest


class EarlyUnclassifiedRoads(FixtureTest):

    def test_early_track_road_z11_grade1_paved(self):

        # asphalt, grade1, track (default zoom 11, no demotion)
        self.generate_fixtures(dsl.way(329375413, wkt_loads('LINESTRING (-110.354671068458 39.1969921660056, -110.354652293669 39.19571140250348, -110.354369683681 39.19447886227498, -110.350572594806 39.18608191995149, -110.350027766586 39.18487720185929, -110.350006476514 39.1848299930892, -110.347557309724 39.1793463185638, -110.347241372238 39.17814350447929, -110.342793903098 39.15753516282658, -110.34293799287 39.1546218583612, -110.343115320307 39.15239606624638, -110.343464405626 39.15060420786089, -110.344084961824 39.14864468931599, -110.345071312006 39.14611781351739, -110.345265348108 39.14519819241018, -110.345159975725 39.14416248958709, -110.344866316458 39.14323845368239, -110.344255641728 39.1422646601258, -110.337983065425 39.13555649590811)'), {u'name': u'Old Highway', u'disused': u'yes', u'surface': u'asphalt', u'source': u'openstreetmap.org', u'tracktype': u'grade1', u'smoothness': u'bad', u'highway': u'track'}))  # noqa

        self.assert_has_feature(
            11, 396, 781, 'roads',
            {'kind': 'path',
             'kind_detail': 'track'})

    def test_early_track_road_z11_grade1_dirt(self):

        # dirt, grade1, track (since dirt demoted from zoom 11)
        self.generate_fixtures(dsl.way(83248656, wkt_loads('POINT (-109.714684400425 38.9714404685997)'), {u'source': u'openstreetmap.org', u'railway': u'level_crossing'}),dsl.way(3059133662, wkt_loads('POINT (-109.714690688632 38.97140051989107)'), {u'source': u'openstreetmap.org', u'railway': u'level_crossing'}),dsl.way(3059133670, wkt_loads('POINT (-109.714681974973 38.97146009374381)'), {u'source': u'openstreetmap.org', u'railway': u'level_crossing'}),dsl.way(3438290300, wkt_loads('POINT (-109.711548920757 38.97847688652848)'), {u'foot': u'yes', u'source': u'openstreetmap.org', u'bicycle': u'yes', u'barrier': u'cattle_grid'}),dsl.way(3438291489, wkt_loads('POINT (-109.710022323763 39.01929365474759)'), {u'foot': u'yes', u'source': u'openstreetmap.org', u'bicycle': u'yes', u'barrier': u'cattle_grid'}),dsl.way(3438291584, wkt_loads('POINT (-109.722268696706 39.03377697547719)'), {u'foot': u'yes', u'source': u'openstreetmap.org', u'bicycle': u'yes', u'barrier': u'cattle_grid'}),dsl.way(286309045, wkt_loads('LINESTRING (-109.714738568836 38.9710932912195, -109.714690688632 38.97140051989107, -109.714684400425 38.9714404685997, -109.714681974973 38.97146009374381, -109.714642538933 38.97177877459279, -109.714614062338 38.97195197769629, -109.71454480223 38.97227016745509, -109.714470691219 38.9723960880733, -109.714356874672 38.97249798373969, -109.714043362638 38.972692066992, -109.713837738269 38.9728075110061, -109.713755632253 38.9728985810453, -109.713659063359 38.97305481058669, -109.713620795128 38.97312416046948, -109.713412924972 38.97350052033038, -109.713126092901 38.9739849872979, -109.71296259952 38.97423891734131, -109.712341863658 38.9753146180401, -109.711852012334 38.9761215748898, -109.711521701804 38.97669366715679, -109.711510203368 38.9768473044295, -109.711538320637 38.9769968211099, -109.711587188988 38.9773353798994, -109.71155260385 38.97835118622288, -109.711548920757 38.97847688652848, -109.711528439169 38.97863240543099, -109.711496818471 38.9787504934221, -109.711450285739 38.97885950291849, -109.711236576533 38.9791871588955, -109.709291903606 38.98196539997309, -109.708934284291 38.98253206815948, -109.70857684464 38.98315641044379, -109.707801239223 38.9846700737189, -109.707081419186 38.98609698088409, -109.706789197224 38.9866602643827, -109.706651665154 38.98696176968708, -109.706545214793 38.98725992211801, -109.706464725744 38.98756247223538, -109.706401394516 38.98789385844079, -109.706382889221 38.9882249637994, -109.706314976586 38.9892582092393, -109.706273923577 38.990749399221, -109.706177264853 38.9923471028199, -109.706181486934 38.9926913133991, -109.705746792168 39.0010671931862, -109.705629562024 39.00349937207309, -109.705526704924 39.00543667816009, -109.705544401735 39.0058593573433, -109.705650223275 39.00628217361301, -109.705853062867 39.0066865586764, -109.707937872978 39.01022128691289, -109.70813783796 39.01063709693879, -109.708287766781 39.01116716915988, -109.708287766781 39.01173150952728, -109.708214913412 39.0121369802407, -109.70805258784 39.0127527552119, -109.707949640908 39.01330570567829, -109.707934908538 39.0139590918395, -109.70803201642 39.0144982826885, -109.708223088081 39.01501687919929, -109.708552410464 39.0155606685756, -109.709040465158 39.01614095723451, -109.709646288985 39.0167691907666, -109.709866825388 39.01708676030939, -109.709905003787 39.01745011395329, -109.709758039407 39.01791376054209, -109.709703421837 39.01820187177859, -109.709675663895 39.01834788119159, -109.709728574665 39.01880482170339, -109.709913807277 39.01920690178559, -109.710022323763 39.01929365474759, -109.710091404209 39.0193367171197, -109.710643059625 39.01967981929619, -109.710937078217 39.02014121790981, -109.711134078759 39.0205684154845, -109.711239990131 39.02092707520291, -109.711425222742 39.02116701816678, -109.712004546269 39.02166951388219, -109.71213390367 39.02188879630979, -109.71215151065 39.0223799808964, -109.712428730746 39.02334196139631, -109.712555662696 39.02374931962299, -109.71284680668 39.0242449577333, -109.713022876475 39.0247472919964, -109.713055215825 39.02483906287441, -109.713264882613 39.0254918539562, -109.713426130206 39.0258144089663, -109.713634898678 39.02604505373859, -109.714526386766 39.02674138004659, -109.715176228043 39.02742897635348, -109.715799030029 39.02813429122228, -109.71724199387 39.02914218072416, -109.717965586832 39.02962026549839, -109.718672471129 39.02988188138511, -109.719229696099 39.03010155703389, -109.719495777087 39.03028571280929, -109.719957421311 39.03081549817699, -109.720418975704 39.03158100031448, -109.721109331 39.0323142556627, -109.721629096223 39.03319941340849, -109.721741385634 39.0333543933758, -109.722268696706 39.03377697547719, -109.72269800158 39.03420178796209, -109.723037025768 39.03460608314909, -109.723236900919 39.0348298610061, -109.723489776671 39.03505831325408, -109.723572062351 39.03527755414879, -109.723577991232 39.03558129446818, -109.723525080462 39.03595815951858, -109.723369312592 39.03631220569087, -109.723081133048 39.03668215901941, -109.722554810124 39.03722808434639, -109.722446024143 39.03735828523939, -109.722446024143 39.0374632970388, -109.722510613012 39.03765287608489, -109.722772292254 39.03810969181449, -109.723054632748 39.03851389486898, -109.723154615239 39.03877659421618, -109.723445669391 39.03937267041411, -109.723669170233 39.03954849902379, -109.723822063495 39.03969927868548, -109.724004421497 39.039918505181, -109.724174921738 39.04001897794971, -109.724751280825 39.0402587863346, -109.724965888346 39.04043238002569, -109.725077638767 39.0406013683298, -109.725060031788 39.04076351857679, -109.724924745506 39.04139837088999, -109.724839495386 39.04157426422979, -109.724674834194 39.04181176489489, -109.724633601522 39.0420446598952, -109.724583565361 39.0426384758779, -109.724536583472 39.04286229806669, -109.72436311879 39.0432094722284, -109.724033796407 39.04374837022031, -109.723998492617 39.04391058301337, -109.724083832569 39.0444861040212, -109.724095510667 39.04475547889368, -109.724027867526 39.04499527120141, -109.723772117165 39.04558676006479, -109.723628027393 39.04572608504119, -109.723260526611 39.0459088047615, -109.723101704468 39.04602747814101, -109.722992918488 39.04617831374198, -109.722945846767 39.04634038142238, -109.722951685816 39.046525401841, -109.722986989607 39.04666242268328, -109.723372187201 39.04719899206888, -109.723516276972 39.04749130939238, -109.723510437923 39.0477287901651, -109.723466330642 39.0479685723796, -109.72327516915 39.04821519071229, -109.723172222218 39.04836371941439, -109.723154615239 39.0485211776363, -109.723204561569 39.0486559621535, -109.723334008801 39.04881125703918, -109.723457527153 39.04915840196418, -109.723595688043 39.04991882198309, -109.723770859524 39.0500293961389, -109.723946569993 39.05017066570749, -109.723991306094 39.0502619152343, -109.723987084013 39.0503475138804, -109.723952768369 39.05042739190399, -109.723892491413 39.05057200926628, -109.723912344181 39.0506647930427, -109.724023465782 39.0508286642419, -109.724072423964 39.0508747071668, -109.724180491293 39.0509529800703, -109.724311465662 39.05107896996277, -109.724441362052 39.05117831067188, -109.724659742497 39.05130102136899, -109.725157678659 39.05157629996269, -109.725284520777 39.05167396570361, -109.725366626794 39.0517336812615, -109.725575574929 39.05177491008099, -109.725776348395 39.05176681779349, -109.725894836181 39.05178209547348, -109.726181668252 39.05190410751182, -109.726325219034 39.05200009853849, -109.72643427451 39.05207599832768, -109.726714009889 39.05222535603859, -109.726790905677 39.0522899543715, -109.726992577459 39.0525094905969, -109.727050788289 39.05261050354039, -109.727080881851 39.05283568933339, -109.727113221201 39.05301901850088, -109.727148524992 39.05310782275529, -109.727239973488 39.05323687822837, -109.727544592201 39.05361385837849, -109.727755606461 39.05384001759899, -109.727907421744 39.05397395485879, -109.728033185884 39.05406519947159, -109.728112237629 39.05414918905679, -109.728147631251 39.0543146566185, -109.728178802791 39.05444949983791, -109.728206830228 39.05477966582677, -109.728234947497 39.05488221019969, -109.728260908808 39.05495566536299, -109.728325318014 39.0550097975142, -109.728437607425 39.05511792217649, -109.728470934922 39.05521795478119, -109.728460514464 39.05531170906031, -109.728391883177 39.05540609103249, -109.728354513261 39.05547556947689, -109.728364843887 39.0555539070385, -109.728531211877 39.055760458287, -109.728565168195 39.0558210772318, -109.728616461998 39.05607478334381, -109.728637213081 39.05617886048429, -109.72859247698 39.0562814028253, -109.728467790818 39.05640898761169, -109.728294236305 39.0565591034786, -109.728239079747 39.05665041450728, -109.72824222385 39.05676976740039, -109.728230815246 39.05686268254639, -109.72818814527 39.05698698775308, -109.728195421624 39.05707976310138, -109.728243211997 39.0571977201541, -109.728273395391 39.05734776458858, -109.728307711035 39.0574164738117, -109.728402303634 39.05750450522629, -109.728490697858 39.0576207176864, -109.728549896835 39.05768768276259, -109.728699645993 39.05774502155869, -109.72876414503 39.05780229055298, -109.728797292864 39.05791620060711, -109.728832686487 39.05798476976718, -109.729136317053 39.05822291280287, -109.729234413082 39.05833298567458)'), {u'name': u'Thompson Canyon Road', u'ref': u'CR 159', u'surface': u'dirt', u'source': u'openstreetmap.org', u'official_ref': u'CR 00159', u'tracktype': u'grade1', u'highway': u'track'}))  # noqa

        self.assert_has_feature(
            11, 399, 782, 'roads',
            {'kind': 'path',
             'kind_detail': 'track'})

    def test_early_track_road_z12_grade1_private(self):

        # private, grade1, track (since private demoted from zoom 11)
        self.generate_fixtures(dsl.way(10611894, wkt_loads('LINESTRING (-121.896506023363 39.20631109378797, -121.896205626732 39.20647738756549, -121.89523571572 39.20684985913981, -121.89387099514 39.20748168502419, -121.892695100433 39.20810021039959, -121.892327869145 39.20825007286289, -121.891859846882 39.2083885892073, -121.891515163308 39.20848415836509, -121.891218809095 39.20852578276459, -121.88785363021 39.20849111896868, -121.887236846936 39.20847009794358, -121.886623028102 39.20841650126179, -121.886207826778 39.20838385598999, -121.885903926717 39.2083698651546, -121.885726419617 39.20840487704091, -121.885621137066 39.20844677991168, -121.885524388509 39.20852209364661, -121.88533223887 39.20865427532048, -121.885040376234 39.20876620147229, -121.884712401324 39.2088454823886, -121.88442359296 39.20887109727477, -121.883701527135 39.20882919465719, -121.883180863596 39.20874991372249, -121.882573063475 39.20861696656359, -121.88215489771 39.2085330913941, -121.881535060164 39.20837919237849, -121.881192083389 39.2082812564658, -121.880978464014 39.20824172010978, -121.880867072919 39.20825097774438, -121.88076484464 39.20829991093588, -121.880668545241 39.2083698651546, -121.880494002581 39.20860541198188, -121.880379736877 39.20868699007239, -121.880262416901 39.20872889277489, -121.880130005228 39.20871260501639, -121.879762863772 39.2085749941884, -121.87955526311 39.20849578257278, -121.879425905709 39.20847476154908, -121.879281546442 39.20847476154908, -121.879085893374 39.20852606118859, -121.878123079052 39.2088152039105, -121.878002704804 39.20888508801038, -121.87784316401 39.20904371909048, -121.877217397583 39.2098082615793, -121.87705794662 39.21012308305618, -121.876934607931 39.21029326564589, -121.876717934285 39.2105403602874, -121.875653071347 39.211739557397)'), {u'tiger:cfcc': u'A41', u'tiger:reviewed': u'no', u'access': u'private', u'source': u'openstreetmap.org', u'tiger:county': u'Sutter, CA', u'tracktype': u'grade1', u'highway': u'track'}))  # noqa

        self.assert_no_matching_feature(
            11, 330, 781, 'roads',
            {'kind': 'path',
             'kind_detail': 'track'})

        self.assert_has_feature(
            12, 661, 1562, 'roads',
            {'kind': 'path',
             'kind_detail': 'track'})

    def test_early_track_road_z12_grade2_dirt(self):

        # dirt, grade2, track (default zoom 12, no demotion)
        self.generate_fixtures(dsl.way(330951783, wkt_loads('LINESTRING (-111.616603718338 38.27013910602821, -111.616146745353 38.27093478353569, -111.615795144751 38.27149800115029, -111.615615571526 38.2717121863169, -111.615397730069 38.27190020609718, -111.614311577059 38.2725766783398, -111.613666137527 38.27299509781018, -111.610727478739 38.27471649514358, -111.603163843709 38.27911307000058, -111.601166439675 38.28024536793401, -111.600590080589 38.2806407548503, -111.599783573127 38.28149096693438, -111.599439967531 38.28179580541827, -111.599089983896 38.2820330186571, -111.597621867227 38.28287101546259, -111.593124002599 38.28527396208529, -111.592793063249 38.2854071590709, -111.592410380938 38.28551250368158, -111.591519162344 38.28564062339359, -111.590715978649 38.28571585924458, -111.589982504219 38.28574526255039, -111.589591916734 38.28581401124038, -111.58620508845 38.28654246130818, -111.585619836042 38.2866767841358, -111.585128816908 38.28684347101558, -111.584616687364 38.28714631273858, -111.583318621779 38.28797466124569, -111.583108775328 38.28807830990819, -111.582904228938 38.2881603826217, -111.582760498493 38.28820247658048, -111.582636261489 38.2882242638963, -111.582487769972 38.28823660298808, -111.58233891913 38.28823392364268, -111.582079665339 38.28821537974888, -111.581809002944 38.28817765736489, -111.581530076048 38.2881113787361, -111.58127513417 38.28802317165849, -111.581032409381 38.28791218993948, -111.579948412327 38.28732766461599, -111.579359207332 38.2870724885748, -111.57857210348 38.28679305603098, -111.577924058834 38.2865933700417, -111.577216545717 38.28642470828378, -111.5768258684 38.28628629535268, -111.576413541684 38.28609760771219, -111.572260989452 38.2842367236232, -111.571714544264 38.28398887009038, -111.571436425853 38.28388902330718, -111.571236101544 38.2838465037668, -111.571011882049 38.28382309332919)'), {u'name': u'Bicknell Fish Hatchery Road', u'ref': u'CR 27', u'surface': u'dirt', u'source': u'openstreetmap.org', u'tracktype': u'grade2', u'highway': u'track'}))  # noqa

        self.assert_has_feature(
            12, 778, 1575, 'roads',
            {'kind': 'path',
             'kind_detail': 'track'})

    def test_remain_z13_track_road_no_grade1(self):

        # gravel, track (no grade so default track at zoom 13)
        self.generate_fixtures(dsl.way(84341859, wkt_loads('POINT (-111.363730570973 38.4694190199655)'), {u'source': u'openstreetmap.org', u'junction': u'yes', u'name': u'Hartnet Junction'}),dsl.way(313839575, wkt_loads('LINESTRING (-111.363730570973 38.4694190199655, -111.364292197688 38.4691876952643, -111.364809896787 38.4689273925468, -111.365262827353 38.46874551065229, -111.366068705994 38.46865337386408, -111.367365873265 38.4681697592953, -111.368592432953 38.46775295914589, -111.369971885904 38.46766307179148, -111.370774889936 38.46761250131359, -111.372480790661 38.4670252059618, -111.373172044272 38.4669491737229, -111.373986816235 38.46679485827548, -111.374616175923 38.4667234679272, -111.375072070929 38.46671657506218, -111.375519162446 38.46660839919728, -111.375901575263 38.46641947788927, -111.376275094758 38.4664171568128, -111.376642775204 38.466470189875, -111.37706633086 38.46658075735399, -111.377507493496 38.46677882182899, -111.377845799032 38.4670252059618, -111.379242230141 38.467697465323, -111.380042988386 38.46816145988961, -111.380363327616 38.4683992585853, -111.380706394223 38.46869726193669, -111.38103302166 38.46884545431779, -111.38154667834 38.4691125093016, -111.382050004393 38.4693356053063, -111.382432686704 38.4694968079167, -111.382807104515 38.4696710920089, -111.383089894166 38.46974269043637, -111.384034203193 38.4698143591251, -111.384404398921 38.46980296528539, -111.384672725697 38.4697329142309, -111.385080291341 38.46951150743869, -111.385768670343 38.46908972139848, -111.386209743148 38.46877061966499, -111.386444742426 38.46864359751091, -111.386783676783 38.46854590424021, -111.387106082138 38.4684855580068, -111.387436841826 38.4685262811698, -111.387883933343 38.46846438757959, -111.388391391647 38.4683569880079, -111.388613904343 38.46835860568429, -111.388848993453 38.46838631717989, -111.389000808736 38.46832758849008, -111.389102677689 38.46821850070111, -111.389312793634 38.46808831254361, -111.38959351716 38.46795798348261, -111.389782792191 38.46791240693948, -111.390061539423 38.46792218339179, -111.390232039664 38.46799216587111, -111.390367236114 38.46815991254259, -111.390602774382 38.46827659647519, -111.391287021134 38.46851108911168, -111.391829783228 38.46866737022349, -111.392110596586 38.46880262133529, -111.392193780582 38.46893766119379, -111.392324844782 38.46912826389708, -111.392408028777 38.46920970947419, -111.392811462171 38.4693740773407, -111.393244090812 38.46947669277639, -111.39336680068 38.46952226833089, -111.393699626492 38.46974051013169, -111.394015743641 38.46985775416509, -111.394587700982 38.46996690980639, -111.394743738347 38.46996845711458, -111.394878934797 38.46992618745698, -111.395080606579 38.46985128359348, -111.395226223486 38.46983327852179, -111.395413432391 38.4698903180109, -111.395658762296 38.46997661564801, -111.395850193283 38.46993589330399, -111.396103877519 38.4698903180109, -111.39638666717 38.46988061215779, -111.396684189192 38.4698854650845, -111.396890083055 38.46993097004839, -111.397016925174 38.47002057324739, -111.397116817833 38.4701378168254, -111.397189581371 38.4702599834462, -111.397264411034 38.47043419536209, -111.397480725355 38.4706963915903, -111.397807262961 38.4708966953625, -111.398408325717 38.471152278792, -111.398766124695 38.47120931723779, -111.399365121326 38.47120277645658, -111.399572991483 38.4712076996253, -111.399647910978 38.47125819725098, -111.399666595936 38.47136066934379, -111.39957927969 38.47146011706949, -111.399437795033 38.47167181226649, -111.399460702072 38.47183300965409, -111.39960218673 38.47189651794997, -111.399785173553 38.4719468744328, -111.399955673794 38.4720577148353, -111.400246907609 38.47228888966949, -111.400831261701 38.47256901321691, -111.401326323255 38.4729841679564, -111.401561322533 38.47313720423519, -111.402083423376 38.47336190535189, -111.402805129875 38.47366811663829, -111.403543365376 38.47400506007638, -111.403755637277 38.47412067962839, -111.403909518686 38.47415331187711, -111.404065466219 38.47411575665849, -111.404269293957 38.47407510698039, -111.40454804119 38.47405070309679, -111.404855804006 38.47404261535259, -111.405107511948 38.4739952844488, -111.405307117605 38.47401652358041, -111.405483906053 38.4740799596248, -111.405639943417 38.47409297033659, -111.405802089326 38.47402629920499, -111.405999718689 38.47389436332419, -111.406068260145 38.47372986510479, -111.406124494682 38.4735427206716, -111.406245138424 38.4734157069238, -111.406334520795 38.47336675804429, -111.406432347329 38.4732545130746, -111.406428125248 38.47313720423519, -111.40632832242 38.47310625942558, -111.4061202726 38.4730997891456, -111.405989298231 38.47306715641999, -111.405987232106 38.47300695462881, -111.406105809724 38.4729694691423, -111.406282598172 38.4729532230812, -111.406448876331 38.47290441454639, -111.406821228016 38.47274476680258, -111.407106173624 38.47268287683328, -111.407520027475 38.47263730327648, -111.407838300581 38.47261128132529, -111.408013022903 38.47265530764809, -111.408152261772 38.47278548756029, -111.408322941676 38.4729955612935, -111.40854123229 38.47319909381451, -111.409056416106 38.47351726167688, -111.409222784097 38.47354897992579, -111.409498387226 38.47353927456509, -111.409975662136 38.47352626375339, -111.410514202149 38.47351585510238, -111.410930211957 38.47349792127439, -111.41126303777 38.47351261998079, -111.411770496074 38.47357450923788, -111.411988786688 38.4735956078361, -111.412194680551 38.47357936191599, -111.412999571046 38.47352556046618, -111.41323259403 38.47353540648619, -111.413355303898 38.4736037659591, -111.41341773681 38.47369167670858)'), {u'source': u'openstreetmap.org', u'name': u'Thousand Lake Mountain Road', u'smoothness': u'very_bad', u'surface': u'gravel', u'highway': u'track'}))  # noqa

        self.assert_has_feature(
            13, 1561, 3146, 'roads',
            {'kind': 'path',
             'kind_detail': 'track'})

    def test_remain_z13_track_road_no_grade2(self):

        # gravel, track (no grade so default track at zoom 13)
        self.generate_fixtures(dsl.way(14351002, wkt_loads('LINESTRING (-114.05246861556 37.63235009271129, -114.052959994021 37.6324225148569, -114.054059891255 37.63257098714889, -114.056905933738 37.6329819699961, -114.057941870923 37.63313698613139, -114.063530919127 37.63397502095129, -114.063980885253 37.6340419637326, -114.06587094061 37.63431798646579, -114.066287938565 37.6343789532045, -114.067342920035 37.63453396642559, -114.067779860589 37.6345899532231, -114.068006864861 37.6346339885527, -114.068324868472 37.6347399862502, -114.068618887064 37.63487301670359, -114.06901594242 37.6350899909962, -114.070208905117 37.6357819569098, -114.07269813677 37.63717597086131, -114.073876097602 37.63782786757358, -114.075005908735 37.6384809678741, -114.076901892973 37.63956499784139, -114.077203906572 37.63973700140489, -114.081220903028 37.64201597546009, -114.086137921567 37.64478197758169, -114.08692394744 37.64524595535201, -114.088019892087 37.64588298648999, -114.08812292885 37.6459559644739, -114.088557893111 37.64633998681597, -114.089462945759 37.64723996694101, -114.090273046483 37.64800415552379, -114.090936901478 37.6486969969208, -114.09144193433 37.64926401106409, -114.091601924283 37.649408964562, -114.091822909842 37.6495949569822, -114.092491166582 37.65005705544561, -114.092895138966 37.65037718692619, -114.093318874285 37.65070001974128, -114.094672904913 37.65175499544629, -114.096045889993 37.65277695553009, -114.096890935181 37.65342295449971, -114.096991905819 37.65348298098189, -114.097200943785 37.65356797100117, -114.097764906121 37.65375295730929, -114.099446911659 37.65423302343329, -114.102848921471 37.65524997103491, -114.104760895722 37.6558349994096, -114.105540902883 37.65605596625799, -114.105599922197 37.65607296368059, -114.107067859203 37.65649796910049, -114.108007946148 37.65678301153319, -114.111906903976 37.65792402372668, -114.113717907588 37.65848499362329, -114.114731925881 37.6587720196848, -114.115952916015 37.65914701514428, -114.116402882141 37.6592709701774, -114.117114886835 37.65949299353459, -114.117649923418 37.6596739826154, -114.117914926427 37.65977496650799, -114.118275869508 37.65992800662428, -114.120009887501 37.6607380045883)'), {u'old_ref': u'NV 75', u'name': u'Crestline Road', u'tiger:reviewed': u'no', u'surface': u'gravel', u'source': u'openstreetmap.org', u'highway': u'track', u'is_in': u'Lincoln, NV'}))  # noqa

        self.assert_has_feature(
            13, 1500, 3170, 'roads',
            {'kind': 'path',
             'kind_detail': 'track'})

    def test_remain_z13_track_road_grade5_gravel(self):

        # gravel, grade5, track (fails zoom 12 test
        # so default zoom 13 for track)
        self.generate_fixtures(dsl.way(10103047, wkt_loads('LINESTRING (-111.871808802349 37.7343427562811, -111.873428195312 37.73419839497789, -111.874834777384 37.73378122333089, -111.876213691345 37.73318835528951, -111.877833084308 37.7331151789169, -111.880341000918 37.7320905600151, -111.88196973636 37.7315344095243, -111.882765014881 37.73138691669028, -111.883486901043 37.73095189637489, -111.884217411032 37.73065278734229, -111.885008108145 37.7303332864069, -111.885584018074 37.73017698124429, -111.88634902337 37.7294726092503, -111.886875346295 37.72831756393359, -111.887362682336 37.72703801955089, -111.887517372228 37.72610667865919, -111.887843999666 37.72539971006217, -111.887972907909 37.7249645835227, -111.888101816152 37.7243528157266, -111.888179071267 37.72377500670588, -111.888162003276 37.72338747707788, -111.888428263926 37.7225229532724, -111.888774294974 37.72220199615239, -111.888804298704 37.72209896556659, -111.889150329752 37.72187151615919)'), {u'horse': u'yes', u'bicycle': u'yes', u'tiger:cfcc': u'A51', u'tiger:reviewed': u'no', u'surface': u'gravel', u'source': u'openstreetmap.org', u'tiger:county': u'Garfield, UT', u'motor_vehicle': u'yes', u'foot': u'yes', u'tracktype': u'grade5', u'highway': u'track'}))  # noqa

        self.assert_has_feature(
            13, 1550, 3167, 'roads',
            {'kind': 'path',
             'kind_detail': 'track'})
